package com.example.project.mapper;

import com.example.project.vo.model.echarts.Biscuits;
import com.example.project.vo.model.echarts.ScoreRank;
import org.apache.ibatis.annotations.Mapper;
import com.example.project.entity.Project;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (Project)表数据库访问层
 */
@Mapper
public interface ProjectMapper extends BaseMapper<Project> {

    @Select("select count(a.id) as value,a.proj_status as name from project a group by a.proj_status")
    List<Biscuits> table1();

    @Select("SELECT c.percentage as score,c.percentage  as amount,\tb.proj_name as product FROM project b LEFT JOIN ( SELECT a.proj_id, sum( a.percentage ) AS percentage FROM progress a GROUP BY a.proj_id ) c ON b.id = c.proj_id")
    List<ScoreRank> table2();
    @Select("select count(a.id) as value,a.apply_status as name from project a group by a.apply_status")

    List<Biscuits> table3();
}

